package mypro1;

/*
 * 测试if
 */

public class Testif {
    public static void main(String[] args) {
        testBigSmall();

        testLucky();
    }

    private static void testLucky() {
        // 初始化random
        double i = 6 * Math.random();
        double j = 6 * Math.random();
        double k = 6 * Math.random();


        int a = (int) (i + j + k);
        int aa = (int) j + (int) k + (int) i;


        //验证强转是否相等
        if (a == aa) {    //如果　ａ　和　aa　相等
            System.out.println("a == aa");//输出啊＝＝　ａ
        } else {
            System.out.println("a != aa");
        }


        System.out.println(a);

        if (a >= 15) {
            System.out.println("今天手气很好！");
        }
        if (a >= 12) {
            System.out.println("今天手气还行！");
        }
        System.out.println("得了" + a + "分");

        System.out.println("测试多选结构");
        if (a >= 15) {
            System.out.println("今天手气很好！");
        } else if (a >= 12) {
            System.out.println("今天手气还行！");
        } else if (a < 12) {
            System.out.println("今天手气不行");
        }
    }

    private static void testBigSmall() {

        double b = Math.random();
        int c = 1 + (int) (b * 6);
        System.out.println(c);

        if (c > 3) {
            System.out.println("大数！");
        } else {
            System.out.println("小数！");
        }
        System.out.println("#################################");

    }
}
